function simMat = GowerSim(R, B, range)
%
%
num_r = size(R, 1);
num_b = size(B, 1);

rangeMat = repmat(range, num_b, 1);
% minMat = repmat(minMaxVec(1, :), num_b, 1);
simMat = zeros(num_b, num_r);

weightVec = [0.05, 0.05, 0.05, 0.05, 0.4, 0.3, 0.10];
weightMat = repmat(weightVec, num_b, 1);

for i = 1 : num_r
    difVec = repmat(R(i, :), num_b, 1) - B;
    normSim = (1 - abs(difVec) ./ rangeMat) .* weightMat; 
    simMat(:, i) = sum(normSim(:, 1 : end - 1), 2) + double(difVec(:, end) < 0.0001) * weightVec(end);
end

